package org.llc.gof.structure.proxy.force;

/**
 * @author harvey
 */
public class RealSubject implements ISubject {

    private ISubject proxy = null;

    public RealSubject(String _name) {
        String name = _name;
    }

    @Override
    public void doSomething() {
        if (isProxy()){
            System.out.println("代理接口真实实现");
        }
    }

    @Override
    public ISubject getProxy() {
        this.proxy = new SubjectProxy(this);
        return this.proxy;
    }


    private boolean isProxy() {
        if (this.proxy == null) {
            return false;
        } else {
            return true;
        }
    }
}